﻿<?php
require('conn.php');
require('session.php');
require('functions.php');
//print_r($userdata);


$aid=guolv($_GET['aid']);//文章id
$uid=guolv($_GET['uid']);//用户id


$row=$mysql->query("select * from `article` where `id` in({$aid}) limit 1");

if($row){
		$data=$row[0];
}
?>

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
<title>收徒赚钱 - <?php echo $config['sitename']?></title>
 
 <link href="Css1/base.css" rel="stylesheet" type="text/css" />
<link href="Css1/header.css" rel="stylesheet" type="text/css" />
<link href="Css1/weiui.css" rel="stylesheet" type="text/css" />
<link href="Css1/information.css" rel="stylesheet" type="text/css" />
<link href="Css1/record.css" rel="stylesheet" type="text/css" />
<script type=text/javascript > var app="/user" </script>
<script type="text/javascript" src="Scripts1/jquery.min.js"></script>
<script type=text/javascript src="Scripts1/jquery.common.js"></script>
</head> 
<body>
<div id="content">
<!DOCTYPE html><html><head><meta http-equiv="Content-Type"content="text/html; charset=utf-8"><meta name="viewport"content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><meta name="format-detection"content="telephone=no"/>
<script type="text/javascript">
        function IsPC() {
            var userAgentInfo = navigator.userAgent;
            var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");
            var flag = true;
            for (var v = 0; v < Agents.length; v++) {
                if (userAgentInfo.indexOf(Agents[v]) > 0) {
                    flag = false;
                    break;
                }
            }
            return flag;
        }
        if (IsPC()) {

        }
        if (/Android\s(\d+\.\d+)/.test(navigator.userAgent)) {
            var version = parseFloat(RegExp.$1);
            if (version > 2.3) {
                var phoneScale = parseInt(window.screen.width) / 640;
                document.write('<meta name="viewport" content="width=640, minimum-scale = ' + phoneScale + ', maximum-scale = ' + phoneScale + ', target-densitydpi=device-dpi">');
            } else {
                document.write('<meta name="viewport" content="width=640, target-densitydpi=device-dpi">');
            }
        } else {
            document.write('<meta name="viewport" content="width=640, user-scalable=no, target-densitydpi=device-dpi">');
        }
        if (navigator.userAgent.indexOf('MicroMessenger') >= 0) {
            document.addEventListener('WeixinJSBridgeReady', function () {

            });
        }
		
window.onload=function () {
    function setheight() {
        var sidebar=document.getElementById('myDIV');
        sidebar.style.height=document.documentElement.clientHeight-100+'px';
    }
    //setheight();
    //onresize=setheight;
}

    </script>
<style>
.pad{ padding:0 20px;}
.rw_head{ width:600px; overflow:hidden; line-height:70px; font-size:28px; color:#333; border-bottom:1px dashed #ddd;}
.rw_rs{ color:#48c; font-size:24px; line-height:50px; border-bottom:1px solid rgba(0,0,0,0.2)}
.rw_sj{ border-top:1px solid #fff; line-height:50px; color:#999; padding-top:30px;}
.rw_sj p{ line-height:40px; font-size:22px;display:block; width:600px; margin:0 0 20px}
.rw_sj span{ color:#c40000;}
.rw_dh,.rw_sj .rw_dh{  background:#48c; border-radius:7px;-moz-border-radius:7px; -webkit-border-radius:7px; height:70px; line-height:70px; color:#fff; text-align:center; font-size:28px;}
.rw_dh.san{ background:#ff7320;font-size:28px; color:#fff;}
.rw_bg{ background:#eee; box-shadow:1px 0px 10px rgba(0,0,0,0.2) inset ; padding:20px; line-height:50px; color:#333; overflow:hidden;}
.rw_bg li{ display:block; width:25%; height:160px; float:left;}
.rw_bg li .imgg{ display:block; width:120px; height:120px; margin:20px auto;border-radius:7px;-moz-border-radius:7px; -webkit-border-radius:7px; border:2px solid #fff; overflow:hidden;}
.db{ width:100%; height:100px;}
.rw_san{ height:80px; line-height:80px;font-size:28px; color:#333;}
.rw_bg .nr{ padding-top:30px; border-bottom:1px solid rgba(0,0,0,0.2); margin-bottom:20px;}
.rw_bg .nr p{text-align:center; color:#999; font-size:22px;}
.rw_bg .nr p img{ width:350px; height:350px; margin:0 auto;}
.rw_bg .nr p a{ color:#48c; text-decoration:underline;}
.rw_bg .nr .kk{ border:1px dashed #6FCC36; border-radius:10px;-moz-border-radius:10px;-webkit-border-radius:10px; padding:15px; line-height:50px; color:#555; overflow:hidden; width:560px; margin:0 auto;}
.rw_bg .nr .rw_set{ display:block; width:100%; height:70px; background:url(Images1/weixinpic.php) no-repeat center top;} 
.rw_bg .bg_img{ background:rgba(0,0,0,0.9); position:fixed; z-index:88; top:0; left:0px; min-height:1137px; height:100%; width:100%; overflow:scroll;}
.rw_bg .bg_img img{ margin-top:0px; width:100%; height:auto; border:none; border-radius:0px;}
</style>
 
 
		<script type="text/javascript" src="Scripts1/jquery.min.js"></script>
 
<script>


u=encodeURI("http://<?php echo $_SERVER['HTTP_HOST']?>/detail.php?aid=<?php echo $data['id']?>&uid=<?php echo $data['userid']?>");
 
 

 $.ajax({
        url: "http://985.so/api.php?format=jsonp&url="+u,
        type: 'GET',
        dataType: 'JSONP',//here
        success: function (data) {
			 $("#short_url").html(data.url);
		 
    

        }
    });
 
 
 
</script>
<body style="background:#f4f4f4;">

<div class="rw_head pad">
<?php echo $data['title']?></div>
<div class="rw_sj pad">
<p class="rw_dh">分享任务图片素材</p>
<p><span>PS：</span>为了更好的引导好友浏览任务，建议分享朋友圈时，附带文章的图片素材，效果会更好！</p>
</div>
<div class="rw_bg">
<ul>
        	<li><div id="a0" onClick="dk('aa0')" class="imgg"><img src="<?php echo $data['pic']?>"  onClick="gb('aa0')" width="120" height="120"/></div>
            <div id="aa0" class="bg_img" style="display:none; position:fixed; top:0; left:0;" >
            <img src="<?php echo $data['pic']?>"  onClick="gb('aa0')"/>
            </div>
            </li></ul>
   
</div>
<div class="rw_san pad">爱悦赚任务获得收益</div>
<div class="rw_bg">

<p class="rw_dh san">专属任务二维码</p>
<div class="nr">
<p>
<img id="a8" src="http://qr.liantu.com/api.php?text=http://<?php echo $_SERVER['HTTP_HOST']?>/detail.php?aid=<?php echo $data['id']?>&uid=<?php echo $data['userid']?>"  onClick="dk('aa8')"/>
         
</p><br>
<p>* 请将此二维码拷贝发送朋友圈获得点击 *</p><br>
<p><a onClick="dk('aaaa')">帮助说明</a></p>
<div class="bg_img" style="display:none" onClick="gb('aaaa')" id="aaaa">
<img src="Picture1/ewmpic.jpg">
</div> 
<br>
</div>
</div> 
   <script>
function dk(aa){
$("#"+aa).css("display","block");};
function gb(aa){ 
$("#"+aa).css("display","none");};
var convertStr = encodeURIComponent('http://zjgsxyy.com/i/u-SgP3x1'); //转换的原链接可能存在"&"这样的特殊符号，导致原链接的某些字段会被当做ajax请求的参数，所以最好先进行转码  
getShortUrl(convertStr);  
function getShortUrl(urlStr){  
            $.ajax({ 
	 	  	type:'get',
	 	  	url:"http://m.wogaogongyi.com.cn/api/short_url",
	 	  	data:{ 
				alias:'', 
                url:urlStr
            },
			jsonpCallback:"fxzhuan",
	        dataType:"jsonp",
			json: 'callback',  
	        cache:false,
	        success:function(r){
			if(r.status==1){
			$("#short_url").html(r.message);
			} 
	        }
		});   
}
    var pattern = "/^http/";
    var prefix = 'http://read.html5.qq.com/image?src=fav&imgflag=2&imageUrl=';
    $("img").each(function() {
        var src = $(this).attr('src');
        if (src.indexOf("sogoucdn.com") >= 0 || src.indexOf("sogou.com") >= 0) {} else if (src.indexOf("imgcdn") >= 0 || src.indexOf("mmbiz") >= 0) {
            var newsrc = prefix + src;
            $(this).attr('src', newsrc)
        }
    })
</script>
</body>